﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace CNav.Model
{
    public class LoginModel
    {
        [Required, Display(Name = "Email"), EmailAddress]
        public string UserName { get; set; }

        [Required, DataType(DataType.Password), Display(Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    public class UserProfileModel
    {
        public int ID { get; set; }

        public int BusinessID { get; set; }
        public bool IsBusinessAdmin { get; set; }

        public string DisplayName
        {
            get { return string.Format("{0}, {1}", FirstName, Lastname); }
        }

        [Display(Name = "Title")]
        public string Title { get; set; }

        [Display(Name = "First name"), Required]
        [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 2)]
        public string FirstName { get; set; }

        [StringLength(20, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 2)]
        [Display(Name = "Last name"), Required]
        public string Lastname { get; set; }

        [Required, Display(Name = "Email address"), EmailAddress]
        public string Email { get; set; }

        [Display(Name = "Position"), Required]
        public string UserPosition { get; set; }

        [Required, Display(Name = "Phone"), Phone]
        public string PhoneNumber { get; set; }

        [Display(Name = "Fax"), Phone]
        public string FaxNumber { get; set; }

        public string IsLogOnText
        {
            get { return IsLogOn ? "Yes" : "No"; }
        }
        public bool IsLogOn { get; set; }
        public DateTime LogOffDate { get; set; }
        public int LogOnAttempt { get; set; }
        public DateTime LockOutExpireDate { get; set; }
        public DateTime PassExpireDate { get; set; }
        [Display(Name = "Account expire date"), Required]
        public DateTime AccountExpireDate { get; set; }
        public string MachineIP { get; set; }

        public IList<string> TitleList
        {
            get { return new[] { "Mr", "Mrs", "Miss", "Dr" }; }
        }
    }
}